package com.lucker.ds.model;

/**
 * user_virtual_money
 * @author 
 */
public class UserVirtualMoney extends BaseValueObject {
    private Long id;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户虚拟资产类型 1 虚拟币（单位：分）
     */
    private Integer userVirtualMoneyType;

    /**
     * 可用数量（单位：分）
     */
    private Long userVirtualMoneyAmount;

    /**
     * 冻结数量（单位：分）
     */
    private Long userFreezeMoneyAmount;

    private String customQuerySqlText = null;

    private String orderStr = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getUserVirtualMoneyType() {
        return userVirtualMoneyType;
    }

    public void setUserVirtualMoneyType(Integer userVirtualMoneyType) {
        this.userVirtualMoneyType = userVirtualMoneyType;
    }

    public Long getUserVirtualMoneyAmount() {
        return userVirtualMoneyAmount;
    }

    public void setUserVirtualMoneyAmount(Long userVirtualMoneyAmount) {
        this.userVirtualMoneyAmount = userVirtualMoneyAmount;
    }

    public Long getUserFreezeMoneyAmount() {
        return userFreezeMoneyAmount;
    }

    public void setUserFreezeMoneyAmount(Long userFreezeMoneyAmount) {
        this.userFreezeMoneyAmount = userFreezeMoneyAmount;
    }

    public void setCustomQuerySqlText(String customQuerySqlText) {
        this.customQuerySqlText = customQuerySqlText;
    }

    public String getCustomQuerySqlText() {
        return customQuerySqlText;
    }

    public void orderById(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by id asc";
            }else{
                this.orderStr = this.orderStr + ",id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by id desc";
            }else{
                this.orderStr = this.orderStr + ",id desc";
            }
        }
    }

    public void orderByUserId(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_id asc";
            }else{
                this.orderStr = this.orderStr + ",user_id asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_id desc";
            }else{
                this.orderStr = this.orderStr + ",user_id desc";
            }
        }
    }

    public void orderByUserVirtualMoneyType(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_virtual_money_type asc";
            }else{
                this.orderStr = this.orderStr + ",user_virtual_money_type asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_virtual_money_type desc";
            }else{
                this.orderStr = this.orderStr + ",user_virtual_money_type desc";
            }
        }
    }

    public void orderByUserVirtualMoneyAmount(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_virtual_money_amount asc";
            }else{
                this.orderStr = this.orderStr + ",user_virtual_money_amount asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_virtual_money_amount desc";
            }else{
                this.orderStr = this.orderStr + ",user_virtual_money_amount desc";
            }
        }
    }

    public void orderByUserFreezeMoneyAmount(boolean isAsc) {
        if(isAsc){
            if(this.orderStr == null){
                this.orderStr = "order by user_freeze_money_amount asc";
            }else{
                this.orderStr = this.orderStr + ",user_freeze_money_amount asc";
            }
        }else{
            if(this.orderStr == null){
                this.orderStr = "order by user_freeze_money_amount desc";
            }else{
                this.orderStr = this.orderStr + ",user_freeze_money_amount desc";
            }
        }
    }
}